<template>
  <div class="app">
    <!-- 顶部导航栏 -->
    <Header 
      @openRegister="showRegisterModal = true" 
      @openLogin="showLoginModal = true"
    />
    
    <!-- 主要内容 -->
    <main class="main-content">
      <div class="content-image">
        <img :src="contentImage" alt="平价改稿" class="main-image">
      </div>
    </main>
    
    <!-- 页脚 -->
    <Footer />
    
    <!-- 注册弹窗 -->
    <RegisterModal 
      :visible="showRegisterModal" 
      @close="showRegisterModal = false"
      @switchToLogin="handleSwitchToLogin"
    />
    
    <!-- 登录弹窗 -->
    <LoginModal 
      :visible="showLoginModal" 
      @close="showLoginModal = false"
      @switchToRegister="handleSwitchToRegister"
    />
  </div>
</template>

<script>
import Header from '@/src/components/Header.vue'
import Footer from '@/src/components/Footer.vue'
import RegisterModal from '@/src/components/RegisterModal.vue'
import LoginModal from '@/src/components/LoginModal.vue'

export default {
  name: 'PingjiaGaigaoPage',
  components: {
    Header,
    Footer,
    RegisterModal,
    LoginModal
  },
  data() {
    return {
      showRegisterModal: false,
      showLoginModal: false,
      contentImage: require('~/assets/images/img/F-2-平价改稿（静态页面）_slices/容器 777.png')
    }
  },
  methods: {
    handleSwitchToLogin() {
      this.showRegisterModal = false
      this.showLoginModal = true
    },
    handleSwitchToRegister() {
      this.showLoginModal = false
      this.showRegisterModal = true
    }
  }
}
</script>

<style scoped>
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: #f5f5f5;
}

.content-image {
  width: 100%;
  max-width: 1400px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
</style>

